﻿@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
    ViewBag.Title = "Index";
    var abc = "a";
}




<div style="text-align:center">

    <fieldset id="Console" class="layui-elem-field layui-field-title" style="display:block;">
        <legend>控制台</legend>
        <div class="layui-field-box">
            <div id="IndexTop">
                <form class="layui-form layui-form-pane" action="">
                    <div class="layui-form-item" style="margin:0;margin-top:15px;">
                        <div class="layui-inline">
                            <div class="layui-input-inline" style="width:auto">
                                <a id="addRole" class="layui-btn layui-btn-normal">添加角色</a>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <div class="layui-input-inline" style="width:auto">
                                <a id="savePerm" class="layui-btn layui-btn-normal">保存权限</a>
                            </div>
                        </div>

                    </div>
                </form>
            </div>
        </div>
    </fieldset>
    <div style="display:none">
        <form id="roleModelForm">
            <input id="roleId" value="" />
            <input id="moduleId" value="" />
            <input id="actionIds" value="" />
        </form>
    </div>
    <div style="padding-top:70px" id="content" class="layui-form layui-fluid">
        <div class="layui-row">
            
            
            <div style="padding-bottom:100px" class="layui-col-md4" id="roleList">
                <!--内容区域 ajax获取-->

            </div> 
            <div style="padding-bottom:100px" class="layui-col-md4" id="moduleList">

            </div>
            <div class="layui-col-md4" id="actionList">

            </div>
        </div>
       
    </div>
       <div id="page"></div>
    </div>

@section Scripts{
    <script type="text/html" id="roleView">
                {{# var textInit=function(value){
                             return value==null?"":value;

                           }
                }}
        <table class="layui-table">
 
            <thead>
                <tr><th style="text-align:left" colspan="3">角色列表</th></tr>
                <tr>
                    <th>角色名称</th>
                    <th>角色备注</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                {{# layui.each(d.rows,function(index,r){}}
                <tr>
                    <td>{{r.Name}}</td>
                    <td>{{textInit(r.Remark)}}</td>
                    <td><button onclick="edit({{r.Id}},event)" class="layui-btn layui-btn-small"><i class="layui-icon">&#xe642;</i></button><button onclick="del({{r.Id}},event)" class="layui-btn layui-btn-small layui-btn-danger"><i class="layui-icon">&#xe640;</i></button></td>
                </tr>
                {{# }); }}
                 
            </tbody>
           
        </table>
      
    </script>
    <script type="text/html" id="moduleView">
        <table class="layui-table">
            
            <thead>
                <tr><th style="text-align:left" colspan="2">模块列表</th></tr>
                <tr>
                    <th>模块名称</th>
                </tr>
            </thead>
            <tbody>
                {{# layui.each(d.rows,function(index,r){}}
                <tr>
                    <td>{{r.Name}}</td>
                </tr>
                {{# }); }}
            </tbody>
        </table>
    </script>
    <script type="text/html" id="actionView">
        {{#
             var cbInit=function(value){
                return value?"checked":"";
             }
        }}
        <table class="layui-table">

            <thead>
                <tr><th style="text-align:left" colspan="3">角色组：<span class="roleName">？？</span>>>模块：<span class="moduleName">？？</span></th></tr>
                <tr>
                    <th>名称</th>
                    <th>操作</th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                {{# layui.each(d.rows,function(index,r){}}
                <tr>
                    <td>{{r.Name}}</td>
                    <td>{{r.Code}}</td>
                    <td><input type="checkbox" data-id="{{r.Id}}" lay-filter="ckOpt" {{cbInit(r.Checked)}}  /></td>
                </tr>
                {{# }); }}
            </tbody>
        </table>
        
    </script>

    <script src="~/js/admin/sysrole/index.js"></script>
}